package com.yudaxian.sys.service.impl;

import cn.hutool.core.date.LocalDateTimeUtil;
import com.yudaxian.sys.entity.ModelPipe;
import com.yudaxian.sys.entity.ModelPipe;
import com.yudaxian.sys.mapper.ModelPipeMapper;
import com.yudaxian.sys.service.IModelPipeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yudaxian
 * @since 2023-12-07
 */
@Service
public class ModelPipeServiceImpl extends ServiceImpl<ModelPipeMapper, ModelPipe> implements IModelPipeService {


    @Override
    public ModelPipe getModelPipeById(Integer id) {
        return this.baseMapper.selectById(id);
    }

    @Override
    public void addModelPipe(ModelPipe modelPipe) {
        modelPipe.setPipeCreateTime(LocalDateTimeUtil.now().toString());
        this.baseMapper.insert(modelPipe);
    }

    @Override
    public void updateModelPipe(ModelPipe modelPipe) {
        this.baseMapper.updateById(modelPipe);
    }

    @Override
    public void deleteModelPipeById(Integer id) {
        this.baseMapper.deleteById(id);
    }
    
}
